<?php
require_once('TCPDF.php');

class SADPDF extends TCPDF
{
    public function Header()
    {
        $this->SetXY(12,8);
        $this->SetMargins(0,5,0);
        
        $this->SetFont('helvetica','b',12);
        $this->Cell(108, 0, $this->title, 0, 0, 'L', '', '', 0, '', 'C', 'C');
        $this->SetFont('helvetica','',9);
        $this->Cell(90, 0, 'Página ' . $this->getAliasNumPage() . ' de ' . $this->getAliasNbPages(), 0, 1, 'R', '', '', 0, '', 'C', 'C');

        $txt = '<hr />';
        
        $this->SetXY(5,14);
        $this->SetMargins(5,0,5);
        $this->writeHTML($txt,true,false,true,false,'');
        
        $this->SetMargins(20,20,20);
    }
    
    public function Footer() 
    {
        $this->SetFont('helvetica','',8);
        
        $txt = '
            <table>
                <tr>
                    <td width="40%" style="text-align:center;"><em>Framework</em> para Avaliação Diagnóstica<br />Alunos: Gabriel Ulian Brigano; Fernando Henrique Gaffo<br />Orientador: Dr. Rodolfo Miranda de Barros</td>
                </tr>
            </table>
        ';
        
        $this->SetXY(12,282);
        $this->writeHTML($txt,true,false,true,false,'');
        
        $txt = '<hr />';
        
        $this->SetXY(5,280);
        $this->SetMargins(5,0,5);
        $this->writeHTML($txt,true,false,true,false,'');
        
        //$this->Image($file, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi)
        $this->Image('images/logo-gaia.jpg', 88, 282, '', 11, 'JPG', '', '', false, 300);
        $this->Image('images/logo-gerti.png', 112, 282, '', 11, 'PNG', '', '', false, 300);
        $this->Image('images/logo-dc.jpg', 141, 282, '', 11, 'JPG', '', '', false, 300);
        $this->Image('images/logo-uel.jpg', 158, 282, '', 11, 'JPG', '', '', false, 300);
        $this->SetMargins(20,20,20);
    }
}